import styles from './index.css';
import React, {useState} from 'react';
import Verify from '../components/Captcha/Verify';
import { connect } from 'dva';


const FirstPage = (props) => {
  //const [isShow,setIsShow] = useState(false);

  const handleClick = (e) =>{
    //console.log("点了我");
    //setIsShow(!isShow);
    const { dispatch } = props;
    dispatch({
      type: 'slider/change',
      // payload: { ...values, type },
    });

    // dispatch({
    //   type: 'slider/fetch',
    //   // payload: { ...values, type },
    //   payload:{"captchaType":"blockPuzzle"}
    // });
  }
  return (
    <div>

    {
      props.isShow ?
       (<Verify captchaType='blockPuzzle'/>)
       : (<div>不显示</div>)
      }
    <button onClick={(e)=>handleClick(e)} >请点我</button>
</div>

    // <VerifyPoints/>
    // <Verify captchaType='blockPuzzle' imgSize={{width:'400px',height:'200px'}}/>
    // <div className={styles.normal}>
    //   <div className={styles.welcome} />
    //   <ul className={styles.list}>
    //     <li>To get started, edit <code>src/pages/index.js</code> and save to reload.</li>
    //     <li>
    //       <a href="https://umijs.org/guide/getting-started.html">
    //         Getting Started
    //       </a>
    //     </li>
    //   </ul>
    // </div>
  );
};

//export default connect()(FirstPage);
export default connect(({ slider }) => ({ ...slider }))(FirstPage);
